import { http } from "../utils/http";

type Result = {
  svg?: string;
  code?: number;
  info?: object;
};

/** 获取验证码 */
export const getVerify = () => {
  return http.request<Result>("get", "/captcha");
};

/** 登录 */
export const getLogin = (data: object) => {
  return http.request("post", "/login", { data });
};

/** 刷新token */
export const refreshToken = (data: object) => {
  return http.request("post", "/refreshToken", { data });
};

export const login = (data: object) => {
  return http.request("post", "/v1/sign_in", { data });
};

/** 获取用户列表 */
export const getUserPage = (params: object) => {
  return http.request("get", "/v1/get_user_page", { params });
};

/** 修改用户信息 */
export const modifyUserInfo = (data: object) => {
  return http.request("post", "/v1/modify_user_info", { data });
};

/** 修改用户信息 */
export const createUserInfo = (data: object) => {
  return http.request("post", "/v1/create_user_info", { data });
};

/** 获取用户信息列表 */
export const getUserList = () => {
  return http.request("get", "/v1/get_user_list");
};

/** 获取用户信息列表 */
export const getUserInfo = () => {
  return http.request("get", "/v1/get_user_info");
};
